<?php 
$this->headLink()->appendStylesheet("//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/css/select2.min.css" , 'screen');
$this->headScript()->appendFile('//code.jquery.com/jquery-1.11.3.min.js' , 'text/javascript');
$this->headScript()->appendFile('//code.jquery.com/jquery-migrate-1.2.1.min.js' , 'text/javascript');
$this->headScript()->appendFile('//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/js/select2.min.js');
    //-------------------INPUT ELEMENTS----------------
    $user_name 		= $this->formText('user_name',$this->Item['user_name'],array('class'=>'txtmedium'));
    $user_avatar 	= $this->formFile('user_avatar');
    $password 		= $this->formPassword('password','',array('class'=>'txtsort'));
    $email			= $this->formText('email',$this->Item['email'],array('class'=>'txtmedium'));
    $first_name		= $this->formText('first_name',$this->Item['first_name'],array('class'=>'txtmedium'));
    $last_name		= $this->formText('last_name',$this->Item['last_name'],array('class'=>'txtmedium'));
    $birthday		= $this->formText('birthday',$this->Item['birthday'],array('class'=>'txtsort'));

    $options		= array('Inactive','Active');
    $status			= $this->formRadio('status',$this->Item['status'],null,$options, ' ');

    $options = $this->slbGroup;
    $slbGroup = $this->formSelect('group_id', $this->Item['group_id'],array('style'=>"min-width: 200px"),$options);
    $sign = $this->cmsReplaceString($this->Item['sign']);
    $sign = $this->cmsEditor('sign',$sign,array('toolbar'=>'Default','language'=>'vi'));
//    echo $this->Item['sign'];
    $arrInput = array(
                                            array('label'=>'User name: ', 'input'=>$user_name),
                                            array('label'=>'Avatar: ', 'input'=>$user_avatar),
                                            array('label'=>'Password: ', 'input'=>$password),
                                            array('label'=>'Email: ', 'input'=>$email),
                                            array('label'=>'Group name: ', 'input'=>$slbGroup),
                                            array('label'=>'First name: ', 'input'=>$first_name),
                                            array('label'=>'Last name: ', 'input'=>$last_name),
                                            array('label'=>'Birthday: ', 'input'=>$birthday),
                                            array('label'=>'Status: ', 'input'=>$status),
                                            array('label'=>'Sign: ', 'input'=>$sign,'style'=>'margin-left: 175px;'),
                                            );
    //------------------------MESSAGES ERROR----------------------
    if(count($this->messageError) > 0){
        $error = $this->formErrors($this->messageError, array('id'=>'errors'));		
    }
    
    
?>
<form name="appForm" method="post" action="" enctype="multipart/form-data">
    
                        <?php echo $this->render('admin-user/toolbar/index.php') ;?>
                        <?php // include_once 'toolbar/index.php';?>
                        <div class="clr"></div>
                        <?php echo $this->render('admin-user/sublink/index.php') ;?>
                        <?php echo $error;?>
                        <!-- BEGIN: CONTENT -->
                        <div id="element-box">
                            <div class="t">
                                <div class="t">
                                    <div class="t"></div>
                                </div>
                            </div>
                            <div class="m">
                                <!-- BEGIN: ELEMENT BOX -->
                                <div id="adminfieldset">
                                    <div class="adminheader">Detail</div>
                                    <?php echo $this->partialLoop('row.php', $arrInput);?>
                                    
                                </div>
                                <!-- Area 4: In du lieu lay tu database -->
                                
                                <!-- Area 4: In du lieu lay tu database - End -->

                                <!-- END: ELEMENT BOX -->	
                                <div class="clr"></div>
                            </div>
                            <div class="b">
                                <div class="b">
                                    <div class="b"></div>
                                </div>
                            </div>
                        </div>
                        <!-- END: 	CONTENT -->
                    </form>
<script type="text/javascript">
    $("#group_id").select2({dropdownAutoWidth: 'true'});
</script>